package com.gr.staffpm.pages.login;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.wicketstuff.annotation.mount.MountPath;
import org.wicketstuff.annotation.strategy.MountHybrid;

import com.gr.staffpm.login.model.SimpleUser;
import com.gr.staffpm.pages.behaviour.AppLoadingIndicatorBehaviour;
import com.gr.staffpm.security.service.UserService;

@MountHybrid
@MountPath(path = "Login")
public class Login extends WebPage {

    private static final long serialVersionUID = 1L;
    @SpringBean(name = "userService")
    private UserService userService;

    public Login() {
        this(null);
    }

    /**
     * Creates a new log-in page with the given parameters (ignored).
     * @param parameters page parameters (ignored)
     */
    public Login(final PageParameters parameters) {
        add(new AppLoadingIndicatorBehaviour());
        add(new LoginForm("loginform", userService, new SimpleUser()));
    }

}
